package com.tao.to;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.tao.base.BaseEntity;

@Entity
@Table(name="k_category")
public class KCategoryTO extends BaseEntity implements Serializable {
	
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="CATEGORY_ID", nullable=false)
	private int categoryId;
	
	@Column(name="CATEGORY_NAME", length=255)
	private String categoryName;
	
	@Column(name="CATEGORY_URL", length=255)
	private String categoryUrl;
	
	//bi-directional many-to-one association to KArticle
	@OneToMany(mappedBy="category")
	private List<KArticleTO> articleList;

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public String getCategoryName() {
		return categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}
	
	public String getCategoryUrl() {
		return categoryUrl;
	}

	public void setCategoryUrl(String categoryUrl) {
		this.categoryUrl = categoryUrl;
	}

	public List<KArticleTO> getArticleList() {
		return articleList;
	}

	public void setArticleList(List<KArticleTO> articleList) {
		this.articleList = articleList;
	}
    
}
